#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
 *单词计数
 **/
#define STRSIZE 128

static void test1(void)
{
	char str[STRSIZE] =  "";
	int count = 0,flag = 0;
	int i;
	gets(str);

	for(i=0;str[i] != '\0';i++)
	{
		if (str[i] != ' '&&str[i] != '\t')//遇到了单词
		{
			if (flag == 0)
			{
				count++;
				flag = 1;
			}
		}else
		{
			flag = 0;
		
		}

	}
	printf("count: %d\n",count);

}

int main(void)
{
	test1();


	exit(0);
}
